package com.app.internationaltravel.controller;


import com.app.internationaltravel.service.intf.UserSignService;
import com.app.internationaltravel.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/usersign/")
@CrossOrigin
@Api(tags = "实现用户签到的相关操作")
public class UserSignController {
    @Resource
    private UserSignService service;

    @ApiOperation(value = "校验今日是否可以签到",notes = "校验今日是否可以签到")
    @GetMapping("checksign.do")
    public R checkSign(int uid){
        return service.checkSign(uid);
    }

    @ApiOperation(value = "实现用户签到",notes = "实现用户签到")
    @GetMapping("sign.do")
    public R sign(int uid){
        return service.sign(uid);
    }

    @ApiOperation(value = "查询当月的签到记录",notes = "查询当月的签到记录")
    @GetMapping("month.do")
    public R month(int uid){
        return service.queryMonth(uid);
    }

    @ApiOperation(value = "查询指定用户的所有签到记录",notes = "查询指定用户的所有签到记录")
    @GetMapping("all.do")
    public R all(int uid){
        return service.queryAll(uid);
    }



}
